home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / initial.scm < prev    next >
Text File  |  1995-10-13  |  2KB  |  60 lines

  1. ; Copyright (c) 1993, 1994 Richard Kelsey and Jonathan Rees.  See file COPYING.
  2.  
  3.  
  4. ; Link script.
  5.  
  6. (define (link-initial-system)
  7.   (let ((structures-to-open        ;Structures to open for the initial
  8.      (struct-list scheme        ;system's read-eval-print loop.
  9.               environments
  10.               module-system
  11.               ensures-loaded
  12.               packages
  13.               packages-internal)))  ; package-for-syntax
  14.     (link-reified-system (append (desirable-structures)
  15.                  structures-to-open)
  16.              'initial
  17.              ;; The expression that evaluates to the
  18.              ;; procedure that maps the reified-structure alist
  19.              ;; to the startup procedure:
  20.              `(start ',(map car structures-to-open))
  21.              ;; Structures to open for evaluating that
  22.              ;; expression and the expression that
  23.              ;; evaluates to the reified-structure alist:
  24.              initial-system
  25.              for-reification
  26.              ;; scheme-level-1
  27.              )))
  28.  
  29. (define (desirable-structures)
  30.   (let ((env (interaction-environment))
  31.     (l '()))
  32.     (for-each (lambda (int)
  33.         (for-each-declaration
  34.              (lambda (name type)
  35.                (if (not (assq name l))
  36.                (let ((s (eval name env)))
  37.                  (if (structure? s)
  38.                  (set! l (cons (cons name s) l))))))
  39.              int))
  40.           (list low-structures-interface
  41.             run-time-structures-interface
  42.             features-structures-interface
  43.             run-time-internals-structures-interface
  44.             compiler-structures-interface
  45.             initial-structures-interface))
  46.     (reverse l)))
  47.  
  48.  
  49. ; Your choice of evaluators:
  50.  
  51. (define scheme (make-scheme environments evaluation))
  52. ; (define scheme (make-scheme mini-environments mini-eval))
  53. ; (define scheme (make-scheme environments run))
  54. ; etc.
  55.  
  56. ; Your choice of command processors.
  57.  
  58. (define initial-system
  59.   (make-initial-system scheme (make-mini-command scheme)))
  60.